<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGroundPersonPlanHistoryConfTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ground_person_plan_history_conf', function (Blueprint $table) {
            $table->increments('id');
            $table->string('city_id',11)->comment('城市id');
            $table->string('salesman_id',15)->comment('个人地推id');
            $table->string('ground_id',11)->comment('地推方案id');
            $table->string('balance_cycle_type',5)->comment('结算周期类型');
            $table->string('balance_describe',255)->comment('结算周期描述');
            $table->string('ground_balance_describe',500)->comment('地推结算描述');
            $table->string('ground_name',100)->comment('地推名称');
            $table->string('valid_ground_describe',500)->comment('地推结算描述');
            $table->dateTime('effect_date')->comment('生效时间');
            $table->dateTime('invalid_date')->comment('失效时间');
            $table->decimal('ground_fee',16,2)->default(0.00)->comment('地推收入');
            $table->string('ground_scheme_type',20)->comment('地推方案类型');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('ground_person_plan_history_conf');
    }
}
